import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {ASYNC_URLS} from 'src/app/shared/crud/async-url.crud';

/**
 *  ${cfg.describe}服务
 */
@Injectable({
  providedIn: 'root'
})
export class  ${cfg.name?cap_first}Service {

  constructor(private http: HttpClient) {

  }

  /**
   * 获取分页列表数据
   */
  public getList(data) {
    return this.http.post(ASYNC_URLS.${cfg.name}List, data);
  }

  /**
   * 根据ID查询数据
   */
  public getById(data) {
    return this.http.post(ASYNC_URLS.${cfg.name}ById, data);
  }

  /**
   * 新增数据
   */
  public save(data) {
    return this.http.post(ASYNC_URLS.${cfg.name}Save, data);
  }

  /**
   * 更新数据
   */
  public update(data) {
    return this.http.post(ASYNC_URLS.${cfg.name}Update, data);
  }

  /**
   * 删除数据
   */
  public delete(data) {
    return this.http.post(ASYNC_URLS.${cfg.name}Delete, data);
  }

}
